jQuery().ready(function(){	

    if ($('.cohesion_form').length)
    {
  

        // added focused state to inputs
        $(':input')
        .focus(function() {
            $(this).closest('.formRow:not(.ui-state-error)').addClass('focused ui-state-highlight ui-corner-all');
        })
        .blur(function() {
            $(this).closest('.formRow:not(.ui-state-error)').removeClass('focused ui-state-highlight ui-corner-all');
        });

        // check error messages in all tabs
        $('.ui-tabs-panel:has(span.ui-icon-alert)').each(function(i) {
            $('.ui-tabs-nav a[href=#' + this.id + ']').prepend('<span class="ui-state-error-text"><span class="ui-icon ui-icon-alert floatright"></span></span>');
        });
    }

    $(".fg-button:not(.ui-state-disabled)")
    .hover(
        function(){
            $(this).addClass("ui-state-hover");
        },
        function(){
            $(this).removeClass("ui-state-hover");
        }
        );
            
    $(".menu-button")
    .hover(
        function(){
            $(this).addClass("ui-state-hover");
        },
        function(){
            $(this).removeClass("ui-state-hover");
        }
        );

});
